package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("C:/Users/tedu/IdeaProjects/2502/demo.txt");
        //File file = new File("./demo.txt");
        String name = file.getName();
        System.out.println("文件的名字是:"+name);
        long len = file.length();
        System.out.println("文件占用的字节是:"+len);
        boolean read = file.canRead();
        System.out.println("是否可读:"+read);
        boolean write = file.canWrite();
        System.out.println("是否可写:"+write);
    }

}
